from manim import *

class CreateCircle(Scene):
    def construct(self):
        circle = Circle()  # 创建一个圆
        circle.set_fill(PINK, opacity=0.5)  # 设置填充颜色
        self.play(Write(circle))  # 显示圆形动画

class SquareToCircle(Scene):
    def construct(self):
        square = Square()  # 创建正方形
        circle = Circle()  # 创建圆形
        circle.set_fill(PINK, opacity=0.5)
        
        self.play(Write(square))  # 显示正方形
        self.wait(1)
        self.play(Transform(square, circle))  # 变换动画
        self.wait(1)
        
class DifferentRotations(Scene):
    def construct(self):
        left_square = Square(color=BLUE, fill_opacity=0.7).shift(2 * LEFT)
        right_square = Square(color=GREEN, fill_opacity=0.7).shift(2 * RIGHT)
        self.play(
            left_square.animate.rotate(PI), Rotate(right_square, angle=PI), run_time=4
        )
        self.wait()
        
class CircleTest(Scene):
    def construct(self):
        circle = Circle(radius=1.5, color=YELLOW, fill_opacity=0.5)
        
        self.play(Create(circle))
        self.play(circle.animate.shift(UP * 2))
        self.wait()

def main():
    print("Hello from manim-project!")

if __name__ == "__main__":
    main()
